import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Login from '../views/Login.vue'
import Myuser from '../views/Myuser.vue'
import News from '../views/News.vue'
import PostNews from '../views/PostNews.vue'
import Integral from '../views/Integral.vue'
import Exit from '../views/Exit.vue'
import NewsStatus from '../views/NewsStatus.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/status',
    name: 'NewsStatus',
    component: NewsStatus
  },
  {
    path: '/exit',
    name: 'Exit',
    component: Exit
  },
  {
    path: '/integral',
    name: 'Integral',
    component: Integral
  },
  {
    path: '/post/news',
    name: 'PostNews',
    component: PostNews
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/user',
    name: 'Myuser',
    component: Myuser
  },
  {
    path: '/news',
    name: 'News',
    component: News
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = new VueRouter({
  // mode: 'history',
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
